package com.sbl.bajw.pc.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.sbl.bajw.common.web.JsonResultUtil;
import com.sbl.bajw.pc.service.UserRoleService;

@Controller
@RequestMapping("/UserRole")
public class UserRoleAction {
	
	@Resource
	private UserRoleService urService;
	
	@RequestMapping(value = "/main")
	public ModelAndView main(){
		ModelAndView mv = new ModelAndView("/view/manager/userRole/main");
		return mv;
	}
	
	@RequestMapping(value = "/ListByUserDialog")
	public ModelAndView ListByUserDialog(){
		ModelAndView mv = new ModelAndView("/view/manager/userRole/list");
		return mv;
	}
	
	@RequestMapping(value = "/userRoleList")
	public @ResponseBody String userRoleList(){
		String result = urService.selectUserRoleList();
		return JsonResultUtil.Success(result);
	}
	
	@RequestMapping(value = "/addRoleToUser")
	public @ResponseBody String addRoleToUser(){
		urService.addRoleToUser();
		return JsonResultUtil.Success();
	}
}
